﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="fact_rev_import.aspx.cs" Inherits="BSC.fact_rev_import" %>
<%@ Import Namespace="Ext.Net.Utilities" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <ext:FormPanel ID="frmCostUpload" runat="server" Layout="AbsoluteLayout" Border="false"
           FileUpload="true" BodyStyle="background:#DFE8F6" PaddingSummary="10px 10px 10px 10px">
            <Items>
                 
                <ext:FileUploadField ID="FileUploadField1" runat="server" 
                    Width="350" Icon="Attach" EmptyText="Chọn file..." LabelWidth="10">
                    <Listeners>
                        <FileSelected Handler="checkType()" />
                    </Listeners>
                </ext:FileUploadField>
                   
            </Items>           
            <BottomBar>
                <ext:StatusBar ID="StatusBar1" runat="Server">
                    <Items>
                        <%--<ext:Button ID="Button1"  runat="Server" Text="Optimize" Icon="Accept">
                            <DirectEvents>
                                <Click OnEvent="OptimizeCode" Before="return #{frmCostUpload}.getForm().isValid()"
                                   Success="SRResultInfo(1,'Optimize thành công')" Failure="alert(result);SRResultInfo(0,'Có lỗi phát sinh trong quá trình Optimize')"/>
                            </DirectEvents>
                        </ext:Button>--%>
                        <ext:Button ID="btnUpload"  Disabled="true" runat="Server" Text="Import" Icon="Disk">
                            <DirectEvents>
                                <Click OnEvent="Upload" Before="return #{frmCostUpload}.getForm().isValid()" 
                                    Success="SRResultInfo(1,'Import thành công')" Failure="SRResultInfo(0,'Có lỗi phát sinh trong quá trình import')">
                                    <EventMask ShowMask="true" Msg="Đang xử lý dữ liệu" />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </Items>
                </ext:StatusBar>
            </BottomBar>
        </ext:FormPanel>
        <ext:GridPanel ID="grid"  runat="server" Height="400" Frame="true">
                <Store>
                    <ext:Store ID="Store1" runat="server" OnRefreshData="refresh">
                        <Reader>
                            <ext:JsonReader IDProperty="cost_code">
                                <Fields>
                                    <ext:RecordField Name="criteria_name" />
                                    <ext:RecordField Name="cost_code" />
                                    <ext:RecordField Name="cost" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel1" runat="server">
                    <Columns>
                        
                        <ext:Column ColumnID="cost_code" Header="Mã HT" Width="150" DataIndex="cost_code">
                        </ext:Column>
                        <ext:Column ColumnID="criteria_name" DataIndex="cost" Header="Tiêu chí" Width="200" />
                        <%--<ext:Column DataIndex="name" Header="Tiêu chí" Width="150" />--%>
                        <ext:Column ColumnID="cost" DataIndex="cost" Header="Giá trị" Width="150" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
            </SelectionModel>
     </ext:GridPanel>
</asp:Content>
